package com.ethink.order.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.PurchaseOrderSaleInfo;
import com.ethink.order.api.info.SaleDemandOrderDetailInfo;
import com.ethink.order.api.request.SaleDemandOrderDetailQueryRequest;
import com.ethink.order.common.entity.SaleDemandOrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 销售需求详情单 Mapper接口
 *
 * @author default
 * @date 2022-10-31
 */
@Mapper
public interface SaleDemandOrderDetailMapper extends BaseMapper<SaleDemandOrderDetail> {

    /**
     * 分页查询
     *
     * @param buildPage
     * @param request
     * @return
     */
    Page<SaleDemandOrderDetailInfo> querySaleDemandOrderDetail(Page buildPage, @Param("request") SaleDemandOrderDetailQueryRequest request);

    /**
     * 详情
     *
     * @param id
     * @return
     */
    SaleDemandOrderDetailInfo getSaleDemandOrderDetailById(@Param("id") Long id);

    /**
     * 列表查询
     *
     * @param request
     * @return
     */
    List<SaleDemandOrderDetailInfo> listSaleDemandOrderDetail(@Param("request") SaleDemandOrderDetailQueryRequest request);

    /**
     * 根据采购需求详情单号查询 预计销售价-本币(含税)
     * @param purchaseDetailOrderNoList
     * @return
     */
    List<PurchaseOrderSaleInfo> queryExceptSalePriceTaxLocal(@Param("list")List<String> purchaseDetailOrderNoList);
}